import pymongo
import datetime
import socket
import threading
import SocketServer
import time


def connmongo():
    from pymongo import Connection
    conn = Connection('localhost', 27017)
    db = conn.aa
    return db
#end connmongo


def connmongo():
    from pymongo import Connection
    conn = Connection('localhost', 27017)
    db = conn.aa
    return db
#end connmongo


db = connmongo()
acts = db.activity
users = db.user

usr = {"jason", "disney"}

for u in usr:
    for i in range(430, 800, 44):
        act = {}
        act["uid"] = u
        act["beg"] = datetime.datetime.now()
        act["end"] = datetime.datetime.now()
        act["cur"] = datetime.datetime.now()
        act["length"] = i;
        act["trace"] = ""

        print act
        acts.insert(act)


